package com.edu.hello;

import java.util.Random;
import java.util.Scanner;

public class RandomDEmo {
    public static void main(String[] args) {
        Random r = new Random();
        int a = r.nextInt(100);
        Scanner scanner = new Scanner(System.in);
        while(true){
            int b=scanner.nextInt();
            if(b==a){
                System.out.println("猜对了");
                break;
            }else if(b > a){
                System.out.println("猜错了，数字过大");
            }else{
                System.out.println("猜错了，数字过小");
            }
        }
    }
}
